<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:p="http://primefaces.org/ui">

    <ui:composition template="/master.xhtml">


        <ui:define name="menu">
            <ui:include src="../menu.xhtml" /> 
        </ui:define>

        <ui:define name="TituloModulo">

            Gestão de Utilizadores
        </ui:define>

        <ui:define name="TituloConteudoPrincipal">
            Registar Utilizador



        </ui:define>

        <ui:define name="ConteudoPrincipal">
            
            <h:form>
                <p:messages globalOnly="true"/>
                <h:panelGrid columns="3">
                    <h:outputLabel value="#{bundle01.caminho}" for="caminho" />
                    <p:inputText id="caminho" value="#{permissaoUsuarioController.selected.caminho}" title="#{bundle01.caminho}" required="true" requiredMessage="#{bundle01.obrigatorio}"/>
                    <p:message for="caminho"/>
                    <h:outputLabel value="#{bundle01.accao}" for="accao" />
                    <p:inputText id="accao" value="#{permissaoUsuarioController.selected.accao}" title="#{bundle01.accao}" required="true" requiredMessage="#{bundle01.obrigatorio}" />
                    <p:message for="accao"/>
                    
                    
                       <h:outputLabel value="Escolha os Grupos a Associar" for="grupos" />
                       <p:selectCheckboxMenu  id="grupos" value="#{permissaoUsuarioController.selected.tipoUsuarioCollection}" label="Grupos">  
                           <f:selectItems value="#{tipoUsuarioController.itemsAvailableSelectMany}" />  
                    </p:selectCheckboxMenu>  
                    
                </h:panelGrid>
                
                <p:commandButton update="@form" action="#{permissaoUsuarioController.create}" value="#{bundle01.salvar}" />
            </h:form>
        </ui:define>
    </ui:composition>

</html>
